{% extends "light.twig" %}

{% block title %}ONKI: {{ vocab_id|upper }}: {% trans "Alphabetical index" %}: {{ letter }}{% endblock %}
{% block content %}
{% include 'vocab-search-nav-bar.twig' %}
<div id=alphabetical-menu>
  <h2 class="centered">{% trans "Alphabetical index" %}</h2>
{% set letters = 'A'..'Z' %} {# it would be nicer to do this according to the actual appearances of letters i.e. only letters with results should be shown #}
{% set rest = ['Å', 'Ä', 'Ö', '!*'] %}
  <div id="alphabetical-indexing">
  {% for letter in [['0-9'], letters, rest] %} {# looping through all letters #}
    {%  for letter2 in letter %}
    <a {% if search_letter == letter2 %} class="highlight" {% endif %}href="{{ path_fix }}{{ vocab_id }}/{{ lang }}/index/{{ letter2 }}">{{ letter2 }}</a>
    {% endfor %}
  {% endfor %}
  </div>    
</div>
{% if search_results %}
  <ul class="alphabetical-search-results">
  {% for key,value in search_results %}
    <li>
    {% if value.altLabel %}
  	{{ value.altLabel }} 	&rarr; <a href="{{ value.uri | link_url(vocab,lang) }}">{{ value.prefLabel }}</a>
  	{% else %}
  	<a href="{{ value.uri | link_url(vocab,lang) }}">{{ value.prefLabel }}</a>
  	{% endif %}
   </li>
  {% endfor %}
  </ul>
   {% else %}<span class="header-text-small-font">{% trans %}Error: the vocabulary does not contain terms beginning with "{{ letter }}"!{% endtrans %}</span>
{% endif %} {# TODO: translate #}
{% endblock %}
